{% extends "base.html" %}

{% block title %}Climbing Regions{% endblock %}
{% block crumb %}&rsaquo; Climbing Regions{% endblock %}

{% block extrahead %}

<script type="text/javascript" src="/static_media/js/heatmap.js"></script>

{% endblock %}

{% block content %}
<h1>Listing Regions</h1>
	<table>
		<tr>
			{%if setter%}<td>
			<FORM>
			<INPUT TYPE="BUTTON" VALUE="List Unset Quotas" ONCLICK="window.location.href='/routes/listquotas'">
			</FORM></td>
			{%endif%}
			<td><FORM>
			<INPUT TYPE="BUTTON" VALUE="View Active Routes" ONCLICK="window.location.href='/routes/allroutes/1'">
			</FORM></td>
			<td><FORM>
			<INPUT TYPE="BUTTON" VALUE="View Archived Routes" ONCLICK="window.location.href='/routes/allroutes/0'">
			</FORM></td>
		</tr>
	</table>


	<table class="socialSearch">
		<thead>
		<tr>
			<th>Region Name</th>
			<th>Type of Climbing</th>
			<th>View Routes</th>
			{%if setter%}<th>Add a Route</th>{%endif%}
			{%if staff%}<th>Edit Region Quota</th>{%endif%}
		</tr>
		</thead>
	<tbody id="searchResults">
	  {% for region in regions %}
	  <tr onClick="window.location='/routes/listroutes/{{region.id}}';">
          <td>{{region.name}}</td>
		  <td>
			  {% if region.type == "H" %}
			  Bouldering
			  {% else %}
			  Roped
			  {%endif%}
		  </td>

		  <td><a href ="/routes/listroutes/{{region.id}}">View</a></td>
		  {%if setter%}<td><a href ="/routes/addroute/{{region.id}}">Add</a></td>{%endif%}
		  {%if staff%}<td><a href ="/routes/editquota/{{region.id}}">Edit Quotas</a></td>{%endif%}
	  </tr>
	  {% endfor %}
	</tbody>
  </table>
{% endblock %}